<template>
  <div>
    <h1>新闻列表</h1>
    <dl v-for="i in from">
      <dt>{{i.title}}</dt>
      <dd>{{i.register}}</dd>
    </dl>
    <button v-for="i in tpages" @click="get_jou(i)">{{i}}</button>
  </div>
</template>

<script>
export default {
  name: "show_jou",
  data(){
    return{
      from:[],
      tpages:0
    }
  },
  methods:{
    get_jou(p){
      this.$axios.get('users/jou/?page='+p).then(res=>{
        if(res.data.code==200){
          this.from=res.data.matter
          this.tpages=res.data.tpages
        }
      })
    }
  },
  mounted() {
    this.get_jou(1)
  }
}
</script>

<style scoped>

</style>
